package com.lxh.cptp.constant;

/**
 * created by lanxinghua@2dfire.com on 2020/2/14
 * 通讯录变更事件：人员，部门，标签
 */
public enum ChangeTypeEnum {
    CREATE_USER("create_user", "新增成员事件"),
    UPDATE_USER("update_user", "更新成员事件"),
    DELETE_USER("delete_user", "删除成员事件"),

    CREATE_PARTY("create_party", "新增部门事件"),
    UPDATE_PARTY("update_party", "更新部门事件"),
    DELETE_PARTY("delete_party", "删除部门事件"),

    UPDATE_TAG("update_tag", "标签成员变更事件"),

    ADD_EXTERNAL_CONTACT("add_external_contact", "添加外部联系人事件"),
    ADD_HALF_EXTERNAL_CONTACT("add_half_external_contact", "外部联系人免验证添加成员事件"),
    DEL_EXTERNAL_CONTACT("del_external_contact", "删除外部联系人事件"),
    DEL_FOLLOW_USER("del_follow_user", "被外部联系人删除");

    ChangeTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static ChangeTypeEnum getByInstance(String key){
        for (ChangeTypeEnum value : ChangeTypeEnum.values()) {
            if (value.key.equalsIgnoreCase(key)){
                return value;
            }
        }
        return null;
    }


    private String key;

    private String desc;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
